:root{ --primary:#2ca36a; --primary-weak:#e6f7f0; --ink:#0f2b1e; }
body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:var(--ink);margin:0;background:#fafdfb;overflow-x:hidden}
a{text-decoration:none;color:var(--ink)}
.site-wrap{display:flex;flex-direction:column;min-height:100vh}
/* 使用 Bootstrap 的 .container 控制中间主体宽度，勿覆盖其样式 */
header{position:sticky;top:0;z-index:1000;padding:0;border-bottom:1px solid #e6eee6;background:linear-gradient(0deg, #f7fff9, #ffffff);box-shadow:0 2px 8px rgba(18,38,32,.06)}
.main{flex:1}
.navbar{min-height:56px}
.navbar-brand{font-weight:800;padding:0}
.navbar-brand a{text-decoration:none;display:inline-flex;flex-wrap:wrap}
.brand-word{display:inline-block;margin:0 -0.5px}
.brand-word:nth-child(odd){color:var(--primary)}
.brand-word:nth-child(even){color:#4a9b6d}
.navbar-nav{flex-direction:row;gap:6px}
.navbar-nav .nav-link{padding:10px 12px;border-radius:8px;transition:background .2s;color:var(--ink)}
.navbar-nav .nav-link:hover{background:var(--primary-weak)}
.navbar-nav .nav-item{position:relative}
.navbar-nav .submenu{display:none;position:absolute;top:100%;left:0;background:#fff;border:1px solid #e6eee6;border-radius:10px;min-width:180px;box-shadow:0 8px 28px rgba(18,38,32,.08);z-index:1000;padding:4px 0;margin-top:0}
/* 添加一个连接区域，确保鼠标移动时不会离开触发区域 */
.navbar-nav .nav-item:hover>.submenu::before{content:'';position:absolute;top:-8px;left:0;right:0;height:8px;background:transparent}
.navbar-nav .nav-item:hover>.submenu,
.navbar-nav .submenu:hover{display:block}
.navbar-nav .submenu a{display:block;padding:8px 16px;color:var(--ink);border-radius:4px;margin:2px 8px}
.navbar-nav .submenu a:hover{background:var(--primary-weak)}
.navbar-toggler{border:1px solid #e6eee6;padding:4px 8px;background:#fff}
.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:center;background-size:100%}
.navbar-extra{display:flex;align-items:center;gap:12px;margin-left:auto}
.navbar-search{display:flex;align-items:center;min-width:240px}
.search-input-group{display:flex;align-items:center;border:1px solid #d9e6df;border-radius:999px;background:#fff;overflow:hidden;transition:border-color .2s, box-shadow .2s, background .2s;min-height:36px;padding-left:4px}
.search-input-group:hover{border-color:var(--primary)}
.search-input-group:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(44,163,106,.1);background:#f4fbf7}
.navbar-search input{flex:1;border:none;padding:6px 12px;font-size:14px;outline:none;background:transparent;color:var(--ink);min-width:0}
.navbar-search input::placeholder{color:#8aa397}
.navbar-search input::-webkit-search-cancel-button{display:none}
.navbar-search button{flex-shrink:0;border:none;background:transparent;color:var(--primary);padding:0 12px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:background .2s,color .2s}
.navbar-search button:hover{background:var(--primary-weak)}
.navbar-search button:focus{outline:none;color:#1c7a4a}
.lang-login{display:flex;gap:8px;align-items:center}
.lang-login select{
    padding:6px 12px;
    border:1px solid #e6eee6;
    border-radius:6px;
    background:#fff;
    font-size:14px;
    color:var(--ink);
    cursor:pointer;
    transition:all .2s;
    min-width:60px;
    appearance:none;
    background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat:no-repeat;
    background-position:right 8px center;
    background-size:12px;
    padding-right:32px;
}
.lang-login select:hover{
    border-color:var(--primary);
    background-color:var(--primary-weak);
}
.lang-login select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(44, 163, 106, .1);
}
.lang-login a:hover{background:var(--primary-weak)}
.user-info{display:flex;align-items:center;gap:8px}
.user-avatar-link{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--ink);padding:4px 8px;border-radius:6px;transition:background .2s}
.user-avatar-link:hover{background:var(--primary-weak)}
.user-avatar-link img{width:28px;height:28px;border-radius:50%;object-fit:cover}
.user-avatar-link span{font-size:14px}
.lang-login a{font-size:14px;text-decoration:none;padding:4px 8px;border-radius:6px;transition:background .2s}
.lang-login a.login-link{color:var(--ink)}
.lang-login a.register-link{color:var(--primary);font-weight:600}
.lang-login a.logout-link{color:#999}
.lang-login a:hover{background:var(--primary-weak)}
@media (max-width: 1199.98px){
  .navbar-search{min-width:200px}
  .navbar-search input{width:180px}
}
@media (max-width: 991.98px){
  .navbar-nav{flex-direction:column;gap:0;padding:8px 0}
  .navbar-nav .nav-link{padding:8px 16px;border-radius:0}
  .navbar-nav .nav-item:hover>.submenu{display:none}
  .navbar-nav .submenu{position:static;display:block;box-shadow:none;border:none;border-left:2px solid var(--primary-weak);margin-left:16px}
  .navbar-extra{flex-direction:column;align-items:stretch;gap:12px;margin-left:0;margin-top:12px}
  .navbar-search{width:100%;min-width:0}
  .navbar-search input{width:100%}
  .search-input-group{width:100%;padding-left:8px}
  .lang-login{flex-wrap:wrap;justify-content:space-between;padding:8px 0;border-top:1px solid #e6eee6}
}


/* 主体布局由Bootstrap grid系统控制 */
@media (min-width: 992px){
  .layout-main > div:first-child{max-width:66.666667%}
}
.card{border:1px solid #e6eee6;border-radius:14px;background:#fff;box-shadow:0 6px 24px rgba(18,38,32,.04)}
.card .card-hd{padding:12px 14px;font-weight:700}
.card .card-bd{padding:12px}
.tabs{display:flex;border-bottom:1px solid #e6eee6;flex-wrap:wrap}
.tabs a{padding:12px 14px;display:block;border-radius:8px 8px 0 0;white-space:nowrap}
.tabs a.active{background:var(--primary-weak);color:var(--primary);box-shadow:inset 0 -2px 0 var(--primary)}
@media (max-width: 575.98px){
  .tabs a{padding:10px 12px;font-size:14px}
}
.post-card{padding:12px 0;border-bottom:1px dashed #e6eee6;display:flex;gap:12px}
.post-card:last-child{border-bottom:none}
.post-cover{flex-shrink:0;width:120px;height:100%;border-radius:8px;overflow:hidden;background:#f0f0f0}
.post-cover img{width:100%;height:100%;object-fit:cover}
.post-content{flex:1;min-width:0}
.post-title{font-size:16px;margin:0 0 8px;line-height:1.4}
.post-title a{color:var(--ink);font-weight:600}
.post-title a:hover{color:var(--primary)}
.post-summary{font-size:13px;color:#666;margin:6px 0;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.post-meta{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:8px;font-size:12px}
.post-meta-item{color:#597a6a;display:flex;align-items:center;gap:4px}
.post-meta-item i{font-size:13px}
.post-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.post-tag{display:inline-block;padding:2px 8px;background:var(--primary-weak);color:var(--primary);border-radius:4px;font-size:11px;text-decoration:none;transition:background .2s}
.post-tag:hover{background:#d4f0e4;color:var(--primary)}
.post-category{display:inline-flex;align-items:center;gap:4px;color:var(--primary);font-size:12px;text-decoration:none;transition:color .2s}
.post-category i{font-size:13px}
.post-category:hover{color:#1e8050}
.muted{
    margin: 0 6px 6px 0;
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    transition: color .2s;
}
.footer{position:sticky;bottom:0;z-index:1000;padding:20px 0;border-top:1px solid #e6eee6;margin-top:20px;background:linear-gradient(180deg, #ffffff, #f7fff9);box-shadow:0 -2px 8px rgba(18,38,32,.06)}
.footer-inner{margin:0 auto;padding:0 16px}
.friend-links{
    border-bottom: 1px dashed var(--primary);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.friend-links a{margin-right:10px;color:var(--primary)}
.footer-right{margin-top:8px;float: right;font-size: 12px;}
/* 进入/切换动效 */
.fade-in{animation:fadeIn .4s ease both}
.to-top-link{position:fixed;bottom:20px;right:20px;background:#fff;color:var(--primary);border:1px solid var(--primary);border-radius:50%;width:30px;height:30px;display:none;align-items:center;justify-content:center;cursor:pointer;transition:all .3s;box-shadow:0 4px 12px rgba(18,38,32,.12);z-index:1000;text-decoration:none;opacity:0;transform:translateY(10px)}
.to-top-link.show{display:flex;opacity:1;transform:translateY(0)}
.to-top-link:hover{background:var(--primary);color:#fff;box-shadow:0 6px 16px rgba(44,163,106,.3);transform:translateY(-2px)}
.to-top-link:active{transform:translateY(0)}
.to-top-link i{font-size:15px;font-weight:bold}
@media (max-width: 575.98px){
  .to-top-link{bottom:20px;right:16px;width:40px;height:40px}
  .to-top-link i{font-size:15px}
}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

@media (max-width: 575.98px){
  .post-card{flex-direction:column}
  .post-cover{width:100%;height:180px}
  .friend-links{display: none;}
  .footer-right{text-align: center;float: none;}
}
